<?php


namespace App\Http\Controllers;


use App\Services\WorkService;
use Dingo\Api\Http\Request;

class WorkController extends Controller
{

    /**
     * 创建工作日报
     * @param Request $request
     * @return \Dingo\Api\Http\Response
     * @author thanatos thanatos915@163.com
     */
    public function create(Request $request)
    {
        WorkService::create($request);
        return $this->response->noContent();
    }

    /**
     * 获取当前月的日报信息
     * @author thanatos thanatos915@163.com
     */
    public function calendar(Request $request)
    {
        return $this->resArray(WorkService::calendar($request));
    }

    /**
     * 获取今日已工作数据
     * @return mixed
     * @author thanatos thanatos915@163.com
     */
    public function dayData()
    {
        return $this->resArray(WorkService::getDayData());
    }

}
